

import task from "../../../models/dict/task.js"  //任务字典模块
import clType from "../../../models/dict/clothesSizeType"  //任务字典模块
import array from "../../../models/comm/array.js"  //数组操作模块
import py from '../../../models/comm/webPy';
import axios from 'axios';
import Vue from 'vue'
import dFlow from '../../../models/dict/flow';
var nodeListShow = require('./nodeListShow.vue');
export default {


    data: function () {


        return {
            taskClassArray: task.classArray(),
            newColor: "",
            showAddColor: false







        }
    },
    props: {

        currObj: {},
        dataType: {}

    },
    methods: {
        getAllSize() {
            return clType.sizeArray()
        },

        getSizeName(sizeId) {
            return clType.getSizeName(sizeId)
        },

        RemoveColor(index) {

            this.currObj[this.dataType].colorArray.splice(index, 1);
            this.sizeChange()

        },
        sizeChange() {



            this.currObj[this.dataType].data = clType.formatDate(this.currObj[this.dataType].sizeIdArray, this.currObj[this.dataType].colorArray, this.currObj[this.dataType].data);

            //   this.currObj[this.dataType].sizeIdArray = clType.fmtSizeIdArray(this.currObj[this.dataType].sizeIdArray);

        },
        addNewColor() {
            var has = false;
            this.currObj[this.dataType].colorArray.forEach(function (color) {
                if (this.newColor == color) {
                    has = true
                }
            }, this);
            if (!has) {
                this.currObj[this.dataType].colorArray.push(this.newColor);
                this.sizeChange()
            }

            this.showAddColor = false

        },
        getFlowJd(flow) {
            return dFlow.getFlowJd(flow)
        },
        getStatusStr(flow) {

            var jd = dFlow.getFlowJd(flow)
 
            return dFlow.getStatusStr(jd);

        }




    },
    mounted() {


    },
    watch: {



    },
    components: {
        nodeListShow
    }



}